package com.youthHostel.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youthHostel.dao.LogisticsDao;
import com.youthHostel.pojo.logistics;
import com.youthHostel.service.LogisticsService;
@Service
public class LogisticsServiceImpl implements LogisticsService{

	@Autowired
	private LogisticsDao logisticsDao;
	
	@Override
	public PageInfo<logistics> findAll(int index) {
		PageHelper.startPage(index, 3);
		List<logistics> list = logisticsDao.findAll();
		return new PageInfo<logistics>(list);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		return logisticsDao.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(logistics record) {
		return logisticsDao.insert(record);
	}

	@Override
	public logistics selectByPrimaryKey(Integer id) {
		return logisticsDao.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKey(logistics record) {
		return logisticsDao.updateByPrimaryKey(record);
	}

	@Override
	public List<logistics> selectAll() {
		return logisticsDao.selectAll();
	}
	@Override
	public List<logistics> findByName(String name, int index) {
		return logisticsDao.findByName(name);
	}

}
